<?php
namespace app\Admin\model;

use think\Db;
use think\Model;

class Cases extends Model
{
	public function get_CaseType($where = '')
	{
		return Db::name('casetype')->where($where)->select();
	}

	public function get_CaseTypeOne($where = '')
	{
		return Db::name('casetype')->where($where)->find();
	}

	public function Edit_CaseType($data,$id)
	{
		return Db::table('win_casetype')->where(array('id'=>$id))->update($data);
	}

	public function Del_CaseType($id)
	{
		return Db::table('win_casetype')->where(array('id'=>$id))->delete();
	}

	public function Add_CaseType($data)
	{
		return Db::table('win_casetype')->insert($data);
	}

	public function get_Case($where = '')
	{
		return Db::name('case')->where($where)->select();
	}

	public function get_CaseOne($where = '')
	{
		return Db::name('case')->where($where)->find();
	}

	public function Edit_Case($data, $id)
	{
		$case = new Cases;
		return Db::table('win_case')->where(array('id'=>$id))->update($data);
	}

	public function Add_Case($data)
	{
		return Db::table('win_case')->insert($data);
	}

	public function Del_Case($id)
	{
		return Db::table('win_case')->where(array('id'=>$id))->delete();
	}

}